//
// Created by two8g on 17-11-27.
//

#include "HourlyClassification.h"
#include "TimeCard.h"

HourlyClassification::HourlyClassification(double hourlyRate) : itsHourlyRate(hourlyRate) {

}

double HourlyClassification::GetRate() {
    return itsHourlyRate;
}

void HourlyClassification::AddTimeCard(TimeCard* timeCard)
{
    itsTimeCards[timeCard->GetDate()] = timeCard;
}

TimeCard* HourlyClassification::GetTimeCard(long date)
{
    auto it = itsTimeCards.find(date);
    if (it == itsTimeCards.end())
    {
        return nullptr;
    }
    return it->second;
}
